
import cv2
import numpy as np

def draw_circle(event,x,y,flags,param):
  if event==cv2.EVENT_LBUTTONDOWN: #鼠标左键按下
    cv2.circle(img,(x,y),100,(255,255,0),2)


img=np.zeros((512,512,3),np.uint8) #创建三通道图像

cv2.namedWindow('image')

cv2.setMouseCallback('image',draw_circle)

while(1):
  cv2.imshow('image',img)
  if cv2.waitKey(1)&0xFF==27: #Esc按下退出
    break
cv2.destroyAllWindows()
